import React from 'react';
import type { Message } from '../types/wechat';

const ChatDetail: React.FC<{
  messages: Message[];
  sessionName: string;
}> = ({ messages, sessionName }) => (
  <div className="chat-detail">
    <h2>{sessionName}</h2>
    <div className="messages">
      {messages.map(msg => (
        <div key={msg.id} className="message">
          <div className="sender">{msg.sender}</div>
          <div className="content">{msg.content}</div>
          <div className="time">{msg.time}</div>
        </div>
      ))}
    </div>
  </div>
);

export default ChatDetail; 